using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TileBreakingIndicatorController:MonoBehaviour {

	[SerializeField] Sprite[] sprites;
	SpriteRenderer spriteRenderer;

	private void Start() {
		spriteRenderer=GetComponent<SpriteRenderer>();
	}
	public void UpdateState(bool isActive,Vector2 position,float stage) {
		if(!spriteRenderer) spriteRenderer=GetComponent<SpriteRenderer>();
		gameObject.SetActive(isActive);
		transform.position=position;
		spriteRenderer.sprite=sprites[(int)(stage*sprites.Length)];
	}

}
